//
//  CBJBaseController.swift
//  Weibo
//
//  Created by 崔健 on 16/5/21.
//  Copyright © 2016年 cbj. All rights reserved.
//

import UIKit

class CBJBaseController: UITableViewController,CBJvisitViewDelegate{

    override func loadView() {
        
        let isLogined = CBJUserAccountViewModel.sharedAccountViewModel.userLogin
        
        if isLogined {
            
            super.loadView()
        }else{
        
            self.loadVisitView()
        }
        
    }
    
    
    
    func loadVisitView(){
        
        view = visitView
    }
    
    
    lazy var visitView :CBJVisitView = {
    
        let view = CBJVisitView()
        view.visitDelegate = self
        return view
    }()
    
    
    func loginBtnDidClicked() {
        
        let nav = UINavigationController(rootViewController: CBJLoginWebController())
        presentViewController(nav, animated: true, completion: nil)
    }
    
    func registerBtnDidClicked() {
        
        print("register")
    }
    
    
}
